package test.com.sms.framework.excel.runner;

import org.junit.runners.model.FrameworkMethod;
import org.junit.runners.model.Statement;

public class InvokeMethodWithParams extends Statement {
    private final FrameworkMethod fMethod;
    private final Object target;
    private final Object[] params;

    public InvokeMethodWithParams(FrameworkMethod fMethod, Object target,
                                  Object[] params) {
        this.fMethod = fMethod;
        this.target = target;
        this.params = params;
    }

    /**override to invoke method with params
     * @throws Throwable
     */
    @Override
    public void evaluate() throws Throwable {
        fMethod.invokeExplosively(target, params);
    }
}
